﻿using Bussiness.Card;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Bussiness.DepositSaving;
using Bussiness.AccumulateDeposit;
using Bussiness.OnlineDeposit;
using Bussiness.DepositSavingCurrency;
using Bussiness.HomeLoanTrust;
using Bussiness.CarLoan;
using Bussiness.ShortTermLoan;
using Bussiness.WorkingCapitalLoan;
using Bussiness.FinancialLeasingLoan;
using Bussiness.LongTermLoan;
using Bussiness.ConsumerLoan;
using Bussiness.EducationLoan;
using Bussiness.OverdraftLoan;
using Bussiness.InternetBanking;
using Bussiness.MobileBanking;
using Bussiness.ConsumerInstallmentLoan;
using Bussiness.PersonalBusinessLoan;
using Bussiness.HomeEquityLoan;
namespace FO.Controllers
{
    public class ContractController : Controller
    {
        //
        // GET: /Contract/
         [Authorize(Roles = "8,9")]
        public ActionResult Index()
        {
            CardBLL cardbll = new CardBLL();
            DepositSavingBLL depositbll = new DepositSavingBLL();
            AccumulateDepositBLL accumulate = new AccumulateDepositBLL();
            OnlineDepositBLL online = new OnlineDepositBLL();
            DepositSavingCurrencyBLL SavingCurrency = new DepositSavingCurrencyBLL();
            HomeLoanTrustBLL homeloan = new HomeLoanTrustBLL();
            CarLoanBLL carloan = new CarLoanBLL();
            ShortTermLoanBLL shorttermloan = new ShortTermLoanBLL();
            WorkingCapitalLoanBLL WorkingCapitalLoan = new WorkingCapitalLoanBLL();
            FinancialLeasingLoanBLL FinancialLeasingLoan = new FinancialLeasingLoanBLL();
            LongTermLoanBLL LongTermLoan = new LongTermLoanBLL();
            ConsumerLoanBLL ConsumerLoan = new ConsumerLoanBLL();
            EducationLoanBLL EducationLoan = new EducationLoanBLL();
            OverdraftLoanBLL OverdraftLoan = new OverdraftLoanBLL();
            InternetBankingBLL InternetBanking = new InternetBankingBLL();
            MobileBankingBLL MobileBanking = new MobileBankingBLL();
            PersonalBusinessLoanBLL PersonalBusinessLoan = new PersonalBusinessLoanBLL();
            ConsumerInstallmentLoanBLL ConsumerInstallmentLoan = new ConsumerInstallmentLoanBLL();
            HomeEquityLoanBLL HomeEquityLoan = new HomeEquityLoanBLL();
            int StatusApplyNewID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["StatusApplyNewID"].ToString());
            int StatusApplyProcessingID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["StatusApplyProcessingID"].ToString());
            int StatusApplyProcessedID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["StatusApplyProcessedID"].ToString());
            int StatusApplySpamID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["StatusApplySpamID"].ToString());
            ViewBag.StatusApplyNew = cardbll.getcontractbycateid(1, StatusApplyNewID);
            ViewBag.StatusApplyProcessing = cardbll.getcontractbycateid(1, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessed = cardbll.getcontractbycateid(1, StatusApplyProcessedID);
            ViewBag.StatusApplySpam = cardbll.getcontractbycateid(1, StatusApplySpamID);

            //FUEL

            ViewBag.StatusApplyNewFuel = cardbll.getcontractbycateid(2, StatusApplyNewID);
            ViewBag.StatusApplyProcessingFuel = cardbll.getcontractbycateid(2, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedFuel = cardbll.getcontractbycateid(2, StatusApplyProcessedID);
            ViewBag.StatusApplySpamFuel = cardbll.getcontractbycateid(2, StatusApplySpamID);

            //RES

            ViewBag.StatusApplyNewRES = cardbll.getcontractbycateid(3, StatusApplyNewID);
            ViewBag.StatusApplyProcessingRES = cardbll.getcontractbycateid(3, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedRES = cardbll.getcontractbycateid(3, StatusApplyProcessedID);
            ViewBag.StatusApplySpamRES = cardbll.getcontractbycateid(3, StatusApplySpamID);

            //Travel

            ViewBag.StatusApplyNewTravel = cardbll.getcontractbycateid(4, StatusApplyNewID);
            ViewBag.StatusApplyProcessingTravel = cardbll.getcontractbycateid(4, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedTravel = cardbll.getcontractbycateid(4, StatusApplyProcessedID);
            ViewBag.StatusApplySpamTravel = cardbll.getcontractbycateid(4, StatusApplySpamID);

            //shopping

            ViewBag.StatusApplyNewshopping = cardbll.getcontractbycateid(5, StatusApplyNewID);
            ViewBag.StatusApplyProcessingshopping = cardbll.getcontractbycateid(5, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedshopping = cardbll.getcontractbycateid(5, StatusApplyProcessedID);
            ViewBag.StatusApplySpamshopping = cardbll.getcontractbycateid(5, StatusApplySpamID);

            //atm

            ViewBag.StatusApplyNewatm = cardbll.getcontractbycateid(6, StatusApplyNewID);
            ViewBag.StatusApplyProcessingatm = cardbll.getcontractbycateid(6, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedatm = cardbll.getcontractbycateid(6, StatusApplyProcessedID);
            ViewBag.StatusApplySpamatm = cardbll.getcontractbycateid(6, StatusApplySpamID);

            //deposit

            ViewBag.StatusApplyNewDeposit = depositbll.getcontractbystatus(StatusApplyNewID);
            ViewBag.StatusApplyProcessingDeposit = depositbll.getcontractbystatus(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedDeposit = depositbll.getcontractbystatus(StatusApplyProcessedID);
            ViewBag.StatusApplySpamDeposit = depositbll.getcontractbystatus(StatusApplySpamID);

            //accumulate

            ViewBag.StatusApplyNewAccumulateDeposit = accumulate.getcontractbystatus(StatusApplyNewID);
            ViewBag.StatusApplyProcessingAccumulateDeposit = accumulate.getcontractbystatus(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedAccumulateDeposit = accumulate.getcontractbystatus(StatusApplyProcessedID);
            ViewBag.StatusApplySpamAccumulateDeposit = accumulate.getcontractbystatus(StatusApplySpamID);

            //online
            ViewBag.StatusApplyNewOnlineDeposit = online.getcontractbystatus(StatusApplyNewID);
            ViewBag.StatusApplyProcessingOnlineDeposit = online.getcontractbystatus(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedOnlineDeposit = online.getcontractbystatus(StatusApplyProcessedID);
            ViewBag.StatusApplySpamOnlineDeposit = online.getcontractbystatus(StatusApplySpamID);

            //SavingCurrency
            ViewBag.StatusApplyNewSavingCurrency = SavingCurrency.getcontractbystatus(StatusApplyNewID);
            ViewBag.StatusApplyProcessingSavingCurrency = SavingCurrency.getcontractbystatus(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedSavingCurrency = SavingCurrency.getcontractbystatus(StatusApplyProcessedID);
            ViewBag.StatusApplySpamSavingCurrency = SavingCurrency.getcontractbystatus(StatusApplySpamID);

            //HomeLoanTrust
            ViewBag.StatusApplyNewHomeLoanTrust = homeloan.getcontractbystatuscount(1, StatusApplyNewID);
            ViewBag.StatusApplyProcessingHomeLoanTrust = homeloan.getcontractbystatuscount(1, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedHomeLoanTrust = homeloan.getcontractbystatuscount(1, StatusApplyProcessedID);
            ViewBag.StatusApplySpamHomeLoanTrust = homeloan.getcontractbystatuscount(1, StatusApplySpamID);

            //HomeLoanMortgage
            ViewBag.StatusApplyNewHomeLoanMortgage = homeloan.getcontractbystatuscount(2, StatusApplyNewID);
            ViewBag.StatusApplyProcessingHomeLoanMortgage = homeloan.getcontractbystatuscount(2, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedHomeLoanMortgage = homeloan.getcontractbystatuscount(2, StatusApplyProcessedID);
            ViewBag.StatusApplySpamHomeLoanMortgage = homeloan.getcontractbystatuscount(2, StatusApplySpamID);

            //CarLoanTrust
            ViewBag.StatusApplyNewCarLoanTrust = carloan.getcontractbystatuscount(1, StatusApplyNewID);
            ViewBag.StatusApplyProcessingCarLoanTrust = carloan.getcontractbystatuscount(1, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedCarLoanTrust = carloan.getcontractbystatuscount(1, StatusApplyProcessedID);
            ViewBag.StatusApplySpamCarLoanTrust = carloan.getcontractbystatuscount(1, StatusApplySpamID);

            //CarLoanMortgage
            ViewBag.StatusApplyNewCarLoanMortgage = carloan.getcontractbystatuscount(2, StatusApplyNewID);
            ViewBag.StatusApplyProcessingCarLoanMortgage = carloan.getcontractbystatuscount(2, StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedCarLoanMortgage = carloan.getcontractbystatuscount(2, StatusApplyProcessedID);
            ViewBag.StatusApplySpamCarLoanMortgage = carloan.getcontractbystatuscount(2, StatusApplySpamID);

            //ShortTermLoan
            ViewBag.StatusApplyNewShortTermLoan = shorttermloan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingShortTermLoan = shorttermloan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedShortTermLoan = shorttermloan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamShortTermLoan = shorttermloan.getcontractbystatuscount(StatusApplySpamID);


            //WorkingCapitalLoan
            ViewBag.StatusApplyNewWorkingCapitalLoan = WorkingCapitalLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingWorkingCapitalLoan = WorkingCapitalLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedWorkingCapitalLoan = WorkingCapitalLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamWorkingCapitalLoan = WorkingCapitalLoan.getcontractbystatuscount(StatusApplySpamID);

            //FinancialLeasingLoan
            ViewBag.StatusApplyNewFinancialLeasingLoan = FinancialLeasingLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingFinancialLeasingLoan = FinancialLeasingLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedFinancialLeasingLoan = FinancialLeasingLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamFinancialLeasingLoan = FinancialLeasingLoan.getcontractbystatuscount(StatusApplySpamID);

            //LongTermLoan
            ViewBag.StatusApplyNewLongTermLoan = LongTermLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingLongTermLoan = LongTermLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedLongTermLoan = LongTermLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamLongTermLoan = LongTermLoan.getcontractbystatuscount(StatusApplySpamID);

            //ConsumerLoan
            ViewBag.StatusApplyNewConsumerLoan = ConsumerLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingConsumerLoan = ConsumerLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedConsumerLoan = ConsumerLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamConsumerLoan = ConsumerLoan.getcontractbystatuscount(StatusApplySpamID);

            //EducationLoan
            ViewBag.StatusApplyNewEducationLoan = EducationLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingEducationLoan = EducationLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedEducationLoan = EducationLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamEducationLoan = EducationLoan.getcontractbystatuscount(StatusApplySpamID);

            //OverdraftLoan
            ViewBag.StatusApplyNewOverdraftLoan = OverdraftLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingOverdraftLoan = OverdraftLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedOverdraftLoan = OverdraftLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamOverdraftLoan = OverdraftLoan.getcontractbystatuscount(StatusApplySpamID);

            //InternetBanking
            ViewBag.StatusApplyNewInternetBanking = InternetBanking.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingInternetBanking = InternetBanking.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedInternetBanking = InternetBanking.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamInternetBanking = InternetBanking.getcontractbystatuscount(StatusApplySpamID);

            //MobileBanking
            ViewBag.StatusApplyNewMobileBanking = MobileBanking.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingMobileBanking = MobileBanking.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedMobileBanking = MobileBanking.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamMobileBanking = MobileBanking.getcontractbystatuscount(StatusApplySpamID);

            //ConsumerInstallmentLoan
            ViewBag.StatusApplyNewConsumerInstallmentLoan = ConsumerInstallmentLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingConsumerInstallmentLoan = ConsumerInstallmentLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedConsumerInstallmentLoan = ConsumerInstallmentLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamConsumerInstallmentLoan = ConsumerInstallmentLoan.getcontractbystatuscount(StatusApplySpamID);

            //PersonalBusinessLoan
            ViewBag.StatusApplyNewPersonalBusinessLoan = PersonalBusinessLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingPersonalBusinessLoan = PersonalBusinessLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedPersonalBusinessLoan = PersonalBusinessLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamPersonalBusinessLoan = PersonalBusinessLoan.getcontractbystatuscount(StatusApplySpamID);
            //HomeEquityLoan
            ViewBag.StatusApplyNewHomeEquityLoan = HomeEquityLoan.getcontractbystatuscount(StatusApplyNewID);
            ViewBag.StatusApplyProcessingHomeEquityLoan = HomeEquityLoan.getcontractbystatuscount(StatusApplyProcessingID);
            ViewBag.StatusApplyProcessedHomeEquityLoan = HomeEquityLoan.getcontractbystatuscount(StatusApplyProcessedID);
            ViewBag.StatusApplySpamHomeEquityLoan = HomeEquityLoan.getcontractbystatuscount(StatusApplySpamID);
            return View();

        }

    }
}
